﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace _201206QuanLyBanHang.ChucNang
{
    class BLL_Dautu
    {
         DataConn da;
         public BLL_Dautu()
        {
            da = new DataConn();
        }
         public DataSet getDautu(string strsql)
        {
            return da.ExectueQueryDataset(strsql, CommandType.Text, null);
        }
         public bool insertDautu(ref string err, int Madt, string Tendt, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Insert_Dautu", CommandType.StoredProcedure, ref err, new SqlParameter("@madautu", Madt), new SqlParameter("@tendautu", Tendt), new SqlParameter("@ghichu", GhiChu));
        }
        public bool deleteDautu(ref string err, int Madt)
        {
            return da.MyExecuteNonQuery("Pro_Delete_Dautu", CommandType.StoredProcedure, ref err, new SqlParameter("@Madautu", Madt));
        }
        public bool updateDautu(ref string err, int Madt, string Tendt, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Update_Dautu", CommandType.StoredProcedure, ref err, new SqlParameter("@Madautu", Madt), new SqlParameter("@Tendautu", Tendt), new SqlParameter("@GhiChu", GhiChu));
        }
        public object layma(ref string err, string str)
        {

            return da.lay(str, CommandType.Text, ref err);


        }
    }
}
